import Vue from 'vue'
import Router from 'vue-router'
import Home from '../components/homepage.vue'
import Personnel from '../components/personnel/personnel.vue'
import Schedule from '../components/schedule/schedule.vue'
import Cleaning from '../components/cleaning/cleaning.vue'
import Repair from '../components/repair/repair.vue'
import Recipe from '../components/recipe/recipe.vue'
import Location from '../components/location/location.vue'
import Message from '../components/message/message.vue'
import Map from '../components/map/map.vue'
import Login from '../components/login/login.vue'
import Register from '../components/login/register.vue'
import Setting from '../components/setting/setting.vue'
import PersonnelS from '../components/setting/personnel.vue'
import ScheduleS from '../components/setting/schedule.vue'
import ScheduleListS from '../components/setting/schedule-list.vue'
import recipeS from '../components/setting/recipe.vue'
import MessageS from '../components/setting/message.vue'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'Home',
      component: Home
    },
    {
      path: '/personnel',
      name: 'personnel',
      meta: {
        requireAuth: true  // 添加该字段，表示进入这个路由是需要登录的
      },
      component: Personnel
    },
    {
      path: '/schedule',
      name: 'schedule',
      meta: {
        requireAuth: true  // 添加该字段，表示进入这个路由是需要登录的
      },
      component: Schedule
    },
    {
      path: '/cleaning',
      name: 'cleaning',
      meta: {
        requireAuth: true  // 添加该字段，表示进入这个路由是需要登录的
      },
      component: Cleaning
    },
    {
      path: '/repair',
      name: 'repair',
      meta: {
        requireAuth: true  // 添加该字段，表示进入这个路由是需要登录的
      },
      component: Repair
    },
    {
      path: '/recipe',
      name: 'recipe',
      meta: {
        requireAuth: true  // 添加该字段，表示进入这个路由是需要登录的
      },
      component: Recipe
    },
    {
      path: '/location',
      name: 'location',
      meta: {
        requireAuth: true  // 添加该字段，表示进入这个路由是需要登录的
      },
      component: Location
    },
    {
      path: '/message',
      name: 'message',
      meta: {
        requireAuth: true  // 添加该字段，表示进入这个路由是需要登录的
      },
      component: Message
    },
    {
      path: '/map',
      name: 'map',
      meta: {
        requireAuth: true  // 添加该字段，表示进入这个路由是需要登录的
      },
      component: Map
    },
    {
      path: '/login',
      name: 'login',
      component: Login
    },
    {
      path: '/register',
      name: 'register',
      component: Register
    },
    {
      path: '/setting',
      name: 'setting',
      meta: {
        requireAuth: true  // 添加该字段，表示进入这个路由是需要登录的
      },
      component: Setting
    },
    {
      path: '/personnel-s',
      name: 'personnel-s',
      meta: {
        requireAuth: true  // 添加该字段，表示进入这个路由是需要登录的
      },
      component: PersonnelS
    },
    {
      path: '/schedule-s',
      name: 'schedule-s',
      meta: {
        requireAuth: true  // 添加该字段，表示进入这个路由是需要登录的
      },
      component: ScheduleS
    },
    {
      path: '/schedule-list-s',
      name: 'schedule-list-s',
      meta: {
        requireAuth: true  // 添加该字段，表示进入这个路由是需要登录的
      },
      component: ScheduleListS
    },
    {
      path: '/recipe-s',
      name: 'recipe-s',
      meta: {
        requireAuth: true  // 添加该字段，表示进入这个路由是需要登录的
      },
      component: recipeS
    },
    {
      path: '/message-s',
      name: 'message-s',
      meta: {
        requireAuth: true  // 添加该字段，表示进入这个路由是需要登录的
      },
      component: MessageS
    }
  ]
})
